package io.renren.controller;

import io.renren.common.utils.Result;
import io.renren.vo.RepairNoticeRespVO;
import io.renren.service.repair.RepairNoticeService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/repairNotice")
@Tag(name = "系统公告表")
public class ApiRepairNoticeController {
    @Resource
    private RepairNoticeService repairNoticeService;


    @GetMapping("list")
    public Result<List<RepairNoticeRespVO>> getRepairList() {

        return new Result<List<RepairNoticeRespVO>>().ok( repairNoticeService.getRepairList());
    }
    @GetMapping("getDetail")
    public Result<RepairNoticeRespVO> getDetail(@RequestParam Long id) {

        return new Result<RepairNoticeRespVO>().ok( repairNoticeService.getDetail(id));
    }
    @GetMapping("getByTitle")
    public Result<List<RepairNoticeRespVO>> getByTitle(@RequestParam String title) {

        return new Result<List<RepairNoticeRespVO>>().ok( repairNoticeService.getByTitle(title));
    }
}
